Running Lua Scripts on the CLR through Bytecode Translation

نویسندگان

  • Fabio Mascarenhas
  • Roberto Ierusalimschy
چکیده

The .NET Common Language Runtime (CLR) aims to provide interoperability among code written in several different languages, but porting scripting languages to it, so that scripts can run natively, has been hard. This paper presents our approach for running scripts written in Lua, a scripting language, on the .NET CLR. Previous approaches for running scripting languages on the CLR have focused on extending the CLR, statically generating CLR classes from user-defined types in the source languages. They required either language extensions or restrictions on the languages’ dynamic features. Our approach, on the other hand, focused on keeping the syntax and semantics of the original language intact, while giving the ability to manipulate CLR objects. We implemented a translator of Lua virtual machine bytecodes to CLR bytecodes. Benchmarks show that the code our translator generates performs better than the code generated by compilers that use the previous approaches. Resumo. O objetivo do Common Language Runtime .NET (CLR) é permitir a interoperabilidade entre código escrito em diversas linguagens, mas a execução nativa de linguagens de script no CLR tem sido difı́cil. Este artigo apresenta nossa abordagem para executar scripts escritos em Lua, uma linguagem de script, no .NET CLR. Abordagens anteriores para se executar linguagens de script no CLR enfatizaram a extensão do CLR, gerando estaticamente novas classes CLR a partir de tipos definidos naquelas linguagens. Aquelas abordagens precisavam fazer extensões àquelas linguagens, ou restringir suas caracterı́sticas dinâmicas. Nossa abordagem, entretanto, enfatiza a conservação da sintaxe e semântica da linguagem original, enquanto dá a ela a habilidade de manipular objetos do CLR. Nós implementamos um tradutor de bytecodes da máquina virtual de Lua para bytecodes do CLR. Testes mostram que o código que nosso tradutor gera tem desempenho melhor do que o do código gerado por compiladores que usam as abordagens anteriores.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type Safety of Generics for the .NET Common Language Runtime

The Microsoft .NET Common Language Runtime (CLR) offers support for generic types and methods. We develop a mathematical specification for the generics design through a type system and a model for the semantics of a subset of bytecode instructions with generics. We formalize the type-consistency checks performed for the subset by the CLR bytecode verifier. We then prove that adding support for ...

متن کامل

Dynamic Reconfiguration of Component-Based Applications

Component based programming is a current trend in the development of software. The application is created using components and binding their interfaces appropriately at the configuration level. This is especially interesting for applications that, for availability reasons, claim for dynamic reconfiguration. This paper describes an approach for dynamic reconfiguration of applications based on CO...

متن کامل

Static Analysis of Lua using Interface Models

Game development businesses often choose Lua for separating scripted game logic from reusable engine code. Lua can easily be embedded, has simple interfaces, and offers a powerful and extensible scripting language. Using Lua, developers can create prototypes and scripts at early development stages. However, when larger quantities of engine code and script are available, developers encounter mai...

متن کامل

FLAME: Flexible Lightweight Active Measurement Environment

We propose a platform for the rapid prototyping of active measurement tools to collect network characteristics. The proposed platform provides its users with basic active measurement primitives upon which sophisticated active measurement tools can be prototyped quickly, practically, and efficiently through scripts in the Lua scripting language. We validate the platform as well as show its flexi...

متن کامل

Bigloo.NET: compiling Scheme to .NET CLR

This paper presents the compilation of the Scheme programming language to .NET. This platform provides a virtual machine, the Common Language Runtime (CLR), that executes bytecode, the Common Intermediate Language (CIL). Since CIL was designed with language agnosticism in mind, it provides a rich set of language constructs and functionalities. As such, the CLR is the first execution environment...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. UCS

دوره 11  شماره 

صفحات  -

تاریخ انتشار 2005